a=input()
dx=''
xx=''
sz=''
space=''
other=''
for p in a:
	if 'a'<=p<='z':
		xx+=p
	elif 'A'<=p<='Z':
		dx+=p
	elif '0'<=p<='9':
		sz+=p
	elif p==' ':
		space+=p
	else :
		other+=p
print('{} {} {} {} {}'.format(len(dx),len(xx),len(sz),len(space),len(other)))